Type.registerNamespace("BM");

BM.Add = function(determinant, actionInfo) {
    BM.Add.initializeBase(this, [determinant, actionInfo]);
}

BM.Add.prototype = {
    run: function() {
        var path = new Path(this.getId());
        var parentPath = path.getParentPath();
        var parent = MItem.getById(parentPath);
        var last = path.getLastPart();
        var irremovable = (this.determinant.type == EQUIPOISE | this.determinant.type == EXCLUDE);
        if (!parent.has(last)) {
            parent.add(last, irremovable);
        }
    }
}

BM.Add.registerClass("BM.Add", BM.Action);

